package com.corpgovernment.organization.service;

import com.corpgovernment.common.base.BaseUserInfo;
import com.corpgovernment.common.tuple.Tuple2;
import com.corpgovernment.common.tuple.Tuple3;
import com.corpgovernment.organization.entity.SyncOrganizationRequestEntity;
import com.corpgovernment.organization.entity.db.MbOrgInfo;
import com.corpgovernment.organization.enumm.ServiceErrorEnum;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * @author ：llw
 * @date ：Created in 2020/12/9 14:33
 * @description：
 * @modified By：
 * @version: $
 */
public interface ISyncOrganizationService {

    /**
     * 新增组织
     *
     * @param org
     * @return
     */
    Tuple3<ServiceErrorEnum, Long, MbOrgInfo> addOrganization(SyncOrganizationRequestEntity.SyncOrganizationInfoEntity org, BaseUserInfo userInfo);
     void sendOrgInitMsg(SyncOrganizationRequestEntity.SyncOrganizationInfoEntity org, MbOrgInfo mbOrgInfo);

    /**
     * 修改组织
     *
     * @param org
     * @return
     */
    Tuple3<ServiceErrorEnum, Long,MbOrgInfo> updateOrganization(SyncOrganizationRequestEntity.SyncOrganizationInfoEntity org);

    /**
     * 删除组织
     *
     * @param org
     * @return
     */
    Tuple3<ServiceErrorEnum, Long,MbOrgInfo> deleteOrganization(SyncOrganizationRequestEntity.SyncOrganizationInfoEntity org, BaseUserInfo userInfo);

    void insertRecordDetailLog(SyncOrganizationRequestEntity.SyncOrganizationInfoEntity org, String errorMessage);

    void syncOrgInfo(SyncOrganizationRequestEntity entity, String tags) throws Exception;

    /**
     * Excel导入组织 校验 + 全部回滚
     *
     * @return
     */
    <PREINSERT> void handleEmployImport(MultipartFile file, BaseUserInfo baseUserInfo,String syncTpye,String defaultBusinessCode) throws Exception;
}